# 封装测试套件
# 指定测试报告路径
# 文件流形式打开文件
import unittest
import time

import app
from scripts.test01_login import TestLogin
from HTMLTestRunner import HTMLTestRunner

suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLogin))

# report = app.BASE_DIR + "/report/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))
report = app.BASE_DIR + "/report/report.html"

with open(report, "wb") as f:
    runner = HTMLTestRunner(f, title='系统登录接口测试报告')
    runner.run(suite)

